#!/bin/bash

#1 获取输入参数个数，如果没有参数，直接退出
FILE_COUNT=$#
if((FILE_COUNT==0)); then
    echo ">>> 错误：未传递文件参数！"
    echo "  用法：oracle12XE_docker.sh rootPassword"
    exit;
fi
ROOT_PASSWORD=$1

docker run -d \
    --privileged=true \
    -v /etc/localtime:/etc/localtime:ro \
    -p 8080:8080 \
    -p 1521:1521 \
    -e ORACLE_PWD=$ROOT_PASSWORD \
    -e oracle_allow_remote=true \
    -v /opt/module/oracle-12c/oradata:/u01/app/oracle/oradata \
    --name oracle-12c \
    docker.io/truevoly/oracle-12c
# ============= 本容器提供如下安装信息:============= 
# hostname：localhost
# 端口：1521
# SID：XE
# username：system/sys
# password:oracle
# ============= 管理界面访问:============= 
# url:http://localhost:8080/apex
# workspace:internal
# username:admin
# password:oracle

# ============== jdbc依赖 ==============
# <dependency>
#     <groupId>com.oracle</groupId>
#     <artifactId>ojdbc6</artifactId>
#     <version>11.2.0.3</version>
# </dependency>
